#!/bin/zsh
# 安装 nvm ;下载 node18.18.0 和 node20.19.2 并设置默认版本为 node18.18.0 ;
# 教程： https://blog.csdn.net/qq_36798133/article/details/147528733

echo "开始执行 installNvm.sh"

brew install nvm
echo "\nexport NVM_DIR=~/.nvm\nsource $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
source ~/.bash_profile
nvm ls
nvm install 18.18.0 && nvm install 20.19.2
nvm alias default 18.18.0

echo 'source ~/.bash_profile' >> ~/.zshrc

echo "已执行 installNvm.sh"
